#!/system/bin/sh
#
# load module to allow button backlight level changes

# Module location
MODULE="/system/lib/modules/backlight.ko"

# Property to disable the module
LOAD_MODULE=`getprop persist.sys.backlight.disable`

DEFYPLUS=0
if [ -f /proc/socinfo ]; then
    DEFYPLUS=1
fi

# can be loaded previously on defy gb
/system/xbin/rmmod $MODULE 2>/dev/null

if [ "$LOAD_MODULE" != "1" ]; then
    # brightness=6 to set the default brightness after test "animation" on module load
    /system/xbin/insmod $MODULE animate=1 brightness=6 log_enable=0 hook_enable=$DEFYPLUS defy_plus=$DEFYPLUS
fi

